package com.power.thread.concept;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class PoolDemo implements Runnable {
    @Override
    public void run() {
        System.out.println(Thread.currentThread().getName());
    }
    public static void main(String[] args) {
        PoolDemo poolDemo = null;
        ExecutorService executorService = Executors.newSingleThreadExecutor();
        for (int i = 0; i < 10; i++) {
            poolDemo = new PoolDemo();
            executorService.execute(poolDemo);
        }
        executorService.shutdown();
    }
}
